import csv

from read_csi.dat_dict import read_bf_file
from read_csi.dict_standard import get_scale_csi


def save_csv(bf,PATH_name):
    csi_list=list(map(get_scale_csi,bf))
    with open(PATH_name,'w',newline='') as csvfile:
        writer=csv.writer(csvfile)
        for row in csi_list:
            writer.writerow(row)
    csv_path='PATH/test1.csv'
    return csv_path

'''path = r"/media/zhutao/8D97075FBC306B37/研读/Scientific-research/data/"
bf = read_bf_file(path+'/test1.dat')
csv_Path=save_csv(bf,"/media/zhutao/8D97075FBC306B37/研读/Scientific-research/data/")'''